<?php
namespace app\admin\validate;

use think\Validate;

class Conf extends Validate
{
    protected $rule =   [
        'cnname'  => 'require|max:25|unique:conf',
        'enname' =>'require|alpha|unique:conf',
        'type'   => 'require',
           
    ];

    protected $message  =   [
        'cnname.require' => '配置名称不得为空！',        
        'cnname.max'     => '配置名称最多不能超过25个字符',
        'cnname.unique'  => '配置名称不得重复！', 

        'enname.require' => '英文名称不得为空！',        
        'enname.alpha'   => '英文名称必须是字母！',
        'enname.unique'  => '英文名称不得重复！', 
        'type.require'  =>'配置类型不能为空！',
        
          
    ];

    protected $scene = [
        'edit'  =>  ['cnname','enname','type'],
        'add' =>['cnname','enname','type'],
    ];

}